<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>商品分类管理</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/treetable.jsp" %>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#treeTable").treeTable({expandLevel :2}).show();
		});
		/* function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        } */
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/eb/commerceClassify/">商品分类列表</a></li>
		<shiro:hasPermission name="eb:commerceClassify:edit"><li><a href="${ctx}/eb/commerceClassify/form">商品分类添加</a></li></shiro:hasPermission>
	</ul>
	<sys:message content="${message}"/>
	<table id="treeTable" class="table table-striped table-bordered table-condensed hide">
		<thead>
			<tr>
				<th>分类名称</th>
				<shiro:hasPermission name="eb:commerceClassify:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody><c:forEach items="${list}" var="classify">
				<tr id="${classify.id}" pId="${classify.parent.id ne '1'?classify.parent.id:'0'}">
					<td title="${classify.name}"><a href="${ctx}/eb/commerceClassify/form?id=${classify.id}">${fns:abbr(classify.name,30)}</a></td>
					<shiro:hasPermission name="eb:commerceClassify:edit"><td nowrap>
						<a href="${ctx}/eb/commerceClassify/form?id=${classify.id}">修改</a>
						<a href="${ctx}/eb/commerceClassify/delete?id=${classify.id}" onclick="return confirmx('要删除该分类及所有子分类项吗？', this.href)">删除</a>
						<a href="${ctx}/eb/commerceClassify/form?parent.id=${classify.id}">添加下级分类</a> 
					</td></shiro:hasPermission>
					<shiro:hasPermission name="hq:commerceClassify:edit">
							<input type="hidden" name="ids" value="${classify.id}"/>
					</shiro:hasPermission>			
				</tr>
			</c:forEach></tbody>
	</table>
</body>
</html>